﻿using OpenAuth.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OpenAuth.Domain.Interface
{
    /// <summary>
    /// ③领域层定义仓储接口，下面是仓储层实现仓储接口
    /// </summary>
    public interface ISortRepository:IRepository<Sort>
    {
        /// <summary>
        /// 分页获取类别
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        IEnumerable<Sort> LoadSorts(int pageindex, int pagesize);
        /// <summary>
        /// 通过IDs获取类别
        /// </summary>
        /// <param name="sortIds"></param>
        /// <returns></returns>
        IEnumerable<Sort> LoadInSorts(params Guid[] sortIds);
        /// <summary>
        /// 获取类别条数
        /// </summary>
        /// <param name="orgIds"></param>
        /// <returns></returns>
        int GetSortCntInSorts(params Guid[] sortIds);
        /// <summary>
        /// 分页获取类别数据（带查询条件）
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <param name="orgIds"></param>
        /// <returns></returns>
        IEnumerable<Sort> LoadInSorts(int pageindex, int pagesize, params Guid[] orgIds);

        /// <summary>
        /// 获取当前节点的所有下级节点ID
        /// </summary>
        Guid[] GetSubIds(Guid sortId);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        void Delete(Guid id);
    }
}
